<?php
/* @var $this ScreenwriterController */
/* @var $model Screenwriter */

$this->breadcrumbs = array(
    Yii::t('default', 'Administration') => array('/'),
    Yii::t('default', 'Screenwriters') => array('index'),
    Yii::t('default', 'Manage'),
);

$this->menu = array(
    array('label' => Yii::t('default', 'List Screenwriter'), 'url' => array('index')),
    array('label' => Yii::t('default', 'Create Screenwriter'), 'url' => array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#screenwriter-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo Yii::t('default', 'Manage Screenwriters'); ?></h1>

<p>
    <?php echo Yii::t('default', 'You may optionally enter a comparison operator'); ?> (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
    <?php echo Yii::t('default', 'or'); ?> <b>=</b>) <?php echo Yii::t('default', 'at the beginning of each of your search values to specify how the comparison should be done'); ?>.
</p>

<?php echo CHtml::link(Yii::t('default', 'Advanced Search'), '#', array('class' => 'search-button')); ?>
<div class="search-form" style="display:none">
    <?php
    $this->renderPartial('_search', array(
        'model' => $model,
        'languages' => $languages,
    ));
    ?>
</div><!-- search-form -->

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'screenwriter-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'id',
        'name',
        array(
            'name' => 'language_id',
            'value' => '$data->language->name',
            'filter' => $languages,
        ),
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>
